Joomla.submitbutton = function(task){
	if (task == 'link.cancel' || document.formvalidator.isValid(document.id('link-form'))){
		Joomla.submitform(task, document.getElementById('link-form'));
	}
}